import React from 'react';
import { Modal } from 'antd';
import Grid from '../../components/table/grid';
import { injectIntl } from 'react-intl';

class chargeHisModle extends React.Component {
    constructor(props){
        super(props);
        this.state = {
            refresh:0
        };
        const common = this.props.intl.messages.common;
        this.columns = [
            {
                title: common.orderNO,
                dataIndex: 'id',
                key: 'id',
            },
            {
                title: common.stubGroup,
                dataIndex: 'groupName',
                key: 'groupName',
            },
            {
                title: common.stubID,
                dataIndex: 'stubId',
                key: 'stubId',
            },
            {
                title: common.energy,
                dataIndex: 'diffElectric',
                key: 'diffElectric',
            },
            {
                title: common.cost,
                dataIndex: 'amount',
                key: 'amount',
            },
            {
                title: common.chargingStartTime,
                dataIndex: 'startTime',
                key: 'startTime',
            },
            {
                title: common.endReason,
                dataIndex: 'endInfo',
                key: 'endInfo',
            }
        ];
    }

    render() {
        const { visible, onCancel, account } = this.props;
        const common = this.props.intl.messages.common;
        return (
            <Modal
                wrapClassName="sass-tableWrapper9"
                visible={visible}
                title={common.chargeHis}
                onCancel={onCancel}
                footer={[<div key={1} style={{height:22}}></div>]}
            >
                <Grid refresh={Symbol('fresh')} params={{accountId:account?account.id:''}} columns={this.columns} url="api/user/userOrder/qry"/>
            </Modal>
        );
    }
}

export default injectIntl(chargeHisModle)